<?php

namespace backend\controllers;

use yii;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use backend\models\YueJuan;
use backend\models\Generalocr;
use PHPUnit\Framework\Exception;
use backend\models\GeneralocrSearch;
use backend\models\GeneralocrGroupSearch;
use yii\db\StaleObjectException;
use yii\helpers\ArrayHelper;

use Imagick;
use backend\models\GeneralocrPdf;
use backend\jobs\UploadPdf;
use yii\helpers\Url;

class YueJuanQueueController extends \yii\web\Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    public function actionPdf2png($pdf_id = 0, $path = '', $filename = '', $filename_random = '', $title = '', $user_id = 0)
    {
        $model = new YueJuan();
        $model->pdf2Png($pdf_id, $path, $filename, $filename_random, $title, $user_id);
    }


    public function actionOcr($id)
    {
        $model = new YueJuan();
        $model->imageOcr($id);
    }
}
